/*
 * Copyright (c) 2016 4PX Information Technology Co.,Ltd. All rights reserved.
 */
package com.open.spring.utils.soap.header;

/**
 * WSS4J的请求封装
 * 
 * @author hcx
 * @date 2017年7月17日
 */
public class Security {
    /**
     * 用户名
     */
    private String username;
    /**
     * 密码,每个渠道的密码加密方式不同，所以这里传已加密码的password
     */
    private String password;
    /**
     * 随机数，可以为空
     */
    private String nonce;
    /**
     * 时间戳,可以为空
     */
    private String created;
    /**
     * password节点的属性，可以为null
     */
    private String password_type;
    /**
     * 命名空间
     */
    public final static String NAMESPACE_WSSE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
    /**
     * 前缀
     */
    public final static String PREFIX = "wsse";
    /**
     * 节点名
     */
    public final static String LOCALPART = "Security";

    /**
     * 
     */
    public Security() {
        super();
        // TODO Auto-generated constructor stub
    }

    /**
     * @param username
     * @param password
     */
    public Security(String username, String password) {
        super();
        this.username = username;
        this.password = password;
    }

    /**
     * @param username
     * @param password
     * @param nonce
     * @param created
     */
    public Security(String username, String password, String nonce, String created) {
        super();
        this.username = username;
        this.password = password;
        this.nonce = nonce;
        this.created = created;
    }
    

    /**
     * @param username
     * @param password
     * @param nonce
     * @param created
     * @param password_type
     */
    public Security(String username, String password, String nonce, String created, String password_type) {
        super();
        this.username = username;
        this.password = password;
        this.nonce = nonce;
        this.created = created;
        this.password_type = password_type;
    }

    /**
     * @return the username
     */
    public String getUsername() {
        return username;
    }

    /**
     * @param username the username to set
     */
    public void setUsername(String username) {
        this.username = username;
    }

    /**
     * @return the password
     */
    public String getPassword() {
        return password;
    }

    /**
     * @param password the password to set
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @return the nonce
     */
    public String getNonce() {
        return nonce == null ? "" : nonce;
    }

    /**
     * @param nonce the nonce to set
     */
    public void setNonce(String nonce) {
        this.nonce = nonce;
    }

    /**
     * @return the created
     */
    public String getCreated() {
        return created == null ? "" : created;
    }

    /**
     * @param created the created to set
     */
    public void setCreated(String created) {
        this.created = created;
    }

    /**
     * @return the password_type
     */
    public String getPassword_type() {
        return password_type;
    }

    /**
     * @param password_type the password_type to set
     */
    public void setPassword_type(String password_type) {
        this.password_type = password_type;
    }

}
